/**
 * Created by xukj on 2018/6/6.
 */

import React from 'react';
import {
  createStackNavigator,
  createBottomTabNavigator,
} from 'react-navigation';
import HomeContainer from '../modules/home/HomeContainer';
import NewsContainer from '../modules/news/NewsContainer';
import ProfileContainer from '../modules/profile/ProfileContainer';
import StoreContainer from '../modules/store/StoreContainer';

const HomeStack = createStackNavigator({
  Home: HomeContainer,
});

const StoreStack = createStackNavigator({
  Store: StoreContainer,
});

const NewStack = createStackNavigator({
  News: NewsContainer,
});

const ProfileStack = createStackNavigator({
  Profile: ProfileContainer,
});

const TabContainer = createBottomTabNavigator({
  Home: {
    screen: HomeStack,
    navigationOptions: {
      tabBarLabel: '首页',
    },
  },
  Store: {
    screen: StoreStack,
    navigationOptions: {
      tabBarLabel: '商城',
    }
  },
  News: {
    screen: NewStack,
    navigationOptions: {
      tabBarLabel: '消息',
    }
  },
  Profile: {
    screen: ProfileStack,
    navigationOptions: {
      tabBarLabel: '个人',
    }
  },
});

const App = createStackNavigator({
  Tab: {
    screen: TabContainer,
    navigationOptions: {
      header: null,
    }
  },
});

export default App;